package com.cctc.juc.demo.Athread.Astate;

import java.util.concurrent.TimeUnit;

/**
 * 线程状态：阻塞。
 */
public class CBlockedThread implements Runnable {
    @Override
    public void run() {
        while (true) {
            synchronized (CBlockedThread.class) {
                System.out.println("处理临界区共享资源...");
                try {
                    TimeUnit.SECONDS.sleep(200);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }
}
